<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/templateAdmin.xhtml">
	<ui:define name="content">
		<h:form>
			<f:loadBundle basename="properties.messages" var="msg" />
			<f:view locale="#{language.locale}">
				<div class="ViewUsers">
					<div class="viewAllUsers">
						<div class="createRepTitle">#{msg.viewAllUsers}</div>
						<br />
						<center>
							<h:panelGrid columns="3">
								<h:outputLabel value="#{msg.search}: "></h:outputLabel>
								<h:inputText id="searchName"
									value="#{userDtoListController.searchText}">
									<f:ajax event="keyup" render="table"></f:ajax>
								</h:inputText>
								<h:outputText value="&nbsp;&nbsp;&nbsp;&nbsp;"></h:outputText>
							</h:panelGrid>
						</center>
						<br />
						<center>
							<h:dataTable id="table" value="#{userDtoListController.userList}"
								var="u">
								<h:column id="userName">
									<f:facet name="header">
										<h:outputText value="#{msg.username}"></h:outputText>
									</f:facet>
							
						#{u.name}
						<f:facet name="  ">
									</f:facet>
								</h:column>
								<h:column>
									<f:facet name="header">
										<h:outputText value="&nbsp;&nbsp;&nbsp;&nbsp;"></h:outputText>
									</f:facet>
								</h:column>


								<h:column>
									<f:facet name="header">
										<h:outputText value=" "></h:outputText>
									</f:facet>
								</h:column>
								<h:column id="userType">
									<f:facet name="header">
										<h:outputText value="#{msg.userType}" />
									</f:facet>
						#{msg[u.type]}
				</h:column>

								<h:column id="actions">
									<f:facet name="header">
									</f:facet>
									<h:commandButton class="selectRepositoryButton"
										value="#{msg.viewDetails}" action="ViewUserDetails.xhtml"
										actionListener="#{selectedUserController.attributeListener}"
										>
										<f:attribute name="cUser" value="#{u.id}" />
									</h:commandButton>
									<h:commandButton class="selectRepositoryButton"
										value="#{msg.edit}"
										actionListener="#{editUserController.attributeListener}"
										action="editUserDetails.xhtml">
										<f:attribute name="idUser" value="#{u.id}" />
									</h:commandButton>
								</h:column>
							</h:dataTable>
						</center>
					</div>
				</div>
			</f:view>
		</h:form>
	</ui:define>
</ui:composition>
</html>